/*
 * CUDAAESDecrypter.h
 *
 *  Created on: Jun 23, 2010
 *      Author: Lukasz Spintzyk
 */

#ifndef CUDAAESDECRYPTER_H_
#define CUDAAESDECRYPTER_H_

#ifndef AESDECRYPTER_H_
#include "Decrypter.h"
#endif

class CudaMemoryManager;


class CUDAAESDecrypter: public AESDecrypter
{
public:
	CUDAAESDecrypter(BigInteger& init_vector, byte* key);
	virtual ~CUDAAESDecrypter();

	virtual void decrypt(void* buffer, uint32_t size);
private:
	void allocDeviceIVMemory(uint32_t size);
	CudaMemoryManager* d_cuMem;
	uint32_t* deviceMemExpandedKey;
	byte* host_IVMemory;
	byte* device_IVMemory;
	uint32_t deviceIVmemorySize;
};

#endif /* CUDAAESDECRYPTER_H_ */
